package com.example.sunmiv1.entity;

import android.text.TextUtils;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public class AllocationDetailInfo {


    /**
     * data : [{"id":"961","merchant_id":"2","store_id":"62","warehouse_id":"474","stock_out_id":"70","warehouse_record_id":"165","goods_class_id":"901","goods_id":"21283","sku_id":"1193","goods_name":"測試規格","sku_name":"xl,三分","sku_id_list":"334,303","goods_number":"29319-9","sku_goods_number":"29319-9","goods_code":"1878755484-9","sku_code":"1878755484-9","company":"","attribute_state":"2","pricing_method":"1","sku_num":1,"stock_price":1,"sale_price":null,"stock_num":8,"subtotal":8,"remarks":null,"stock_order_number":"SD201910260070","type":"3","add_time":"1572071657","cost_price":"1.00","examine_status":"1","supplier_id":"0","index":1}]
     * status : 1
     */

    private int status;
    private List<DataBean> data;

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public List<DataBean> getData() {
        if (data == null) {
            return new ArrayList<>();
        }
        return data;
    }

    public void setData(List<DataBean> data) {
        this.data = data;
    }

    public static class DataBean {
        /**
         * id : 961
         * merchant_id : 2
         * store_id : 62
         * warehouse_id : 474
         * stock_out_id : 70
         * warehouse_record_id : 165
         * goods_class_id : 901
         * goods_id : 21283
         * sku_id : 1193
         * goods_name : 測試規格
         * sku_name : xl,三分
         * sku_id_list : 334,303
         * goods_number : 29319-9
         * sku_goods_number : 29319-9
         * goods_code : 1878755484-9
         * sku_code : 1878755484-9
         * company :
         * attribute_state : 2
         * pricing_method : 1
         * sku_num : 1
         * stock_price : 1
         * sale_price : null
         * stock_num : 8
         * subtotal : 8
         * remarks : null
         * stock_order_number : SD201910260070
         * type : 3
         * add_time : 1572071657
         * cost_price : 1.00
         * examine_status : 1
         * supplier_id : 0
         * index : 1
         */

        private String id;
        private String merchant_id;
        private String store_id;
        private String warehouse_id;
        private String stock_out_id;
        private String warehouse_record_id;
        private String goods_class_id;
        private String goods_id;
        private String sku_id;
        private String goods_name;
        private String sku_name;
        private String sku_id_list;
        private String goods_number;
        private String sku_goods_number;
        private String goods_code;
        private String sku_code;
        private String company;
        private String attribute_state;
        private String pricing_method;
        private double sku_num;
        private double stock_price;
        private String sale_price;
        private double stock_num;
        private double subtotal;
        private String remarks;
        private String stock_order_number;
        private String type;
        private String add_time;
        private String cost_price;
        private String examine_status;
        private String supplier_id;
        private double warehouse_price;
        private String refund_price;
        private double warehouse_num;
        private String surplus_num;
        private String warehouse_order_number;
        private String purchase_order_number;
        private String purchase_warehouse_id;
        private int index;
        private double purchase_price;
        private double purchase_num;

        private String build_date;
        private String quality_guarantee_period;

        private String retail_price;
        private String online_price;
        private String serial_number_state;

        public String getSerial_number_state() {
            return serial_number_state == null ? "" : serial_number_state;
        }

        public void setSerial_number_state(String serial_number_state) {
            this.serial_number_state = serial_number_state;
        }

        public String getRetail_price() {
            return retail_price == null ? "" : retail_price;
        }

        public void setRetail_price(String retail_price) {
            this.retail_price = retail_price;
        }

        public String getOnline_price() {
            return online_price == null ? "" : online_price;
        }

        public void setOnline_price(String online_price) {
            this.online_price = online_price;
        }

        public String getBuild_date() {
            if (build_date == null) {
                return "";
            }
            if (build_date.indexOf("-") != -1) {
                return build_date;
            } else {
                String a = build_date == null ? "" : build_date + "000";
                SimpleDateFormat time = new SimpleDateFormat("yyyy年MM月dd日");
                if (TextUtils.isEmpty(a) || TextUtils.isEmpty(build_date)) {
                    return "";
                } else {
                    return time.format(new Date(Long.parseLong(a)));
                }
            }
        }

        public void setBuild_date(String build_date) {
            this.build_date = build_date;
        }

        public String getQuality_guarantee_period() {
            String a = quality_guarantee_period == null ? "" : quality_guarantee_period;
            return a;
        }

        public void setQuality_guarantee_period(String quality_guarantee_period) {
            this.quality_guarantee_period = quality_guarantee_period;
        }

        public double getPurchase_num() {
            return purchase_num;
        }

        public void setPurchase_num(double purchase_num) {
            this.purchase_num = purchase_num;
        }

        public double getPurchase_price() {
            return purchase_price;
        }

        public void setPurchase_price(double purchase_price) {
            this.purchase_price = purchase_price;
        }

        public double getWarehouse_price() {
            return warehouse_price;
        }

        public void setWarehouse_price(double warehouse_price) {
            this.warehouse_price = warehouse_price;
        }

        public String getRefund_price() {
            return refund_price == null ? "" : refund_price;
        }

        public void setRefund_price(String refund_price) {
            this.refund_price = refund_price;
        }

        public double getWarehouse_num() {
            return warehouse_num;
        }

        public void setWarehouse_num(double warehouse_num) {
            this.warehouse_num = warehouse_num;
        }

        public String getSurplus_num() {
            return surplus_num == null ? "" : surplus_num;
        }

        public void setSurplus_num(String surplus_num) {
            this.surplus_num = surplus_num;
        }

        public String getWarehouse_order_number() {
            return warehouse_order_number == null ? "" : warehouse_order_number;
        }

        public void setWarehouse_order_number(String warehouse_order_number) {
            this.warehouse_order_number = warehouse_order_number;
        }

        public String getPurchase_order_number() {
            return purchase_order_number == null ? "" : purchase_order_number;
        }

        public void setPurchase_order_number(String purchase_order_number) {
            this.purchase_order_number = purchase_order_number;
        }

        public String getPurchase_warehouse_id() {
            return purchase_warehouse_id == null ? "" : purchase_warehouse_id;
        }

        public void setPurchase_warehouse_id(String purchase_warehouse_id) {
            this.purchase_warehouse_id = purchase_warehouse_id;
        }

        public String getId() {
            return id == null ? "" : id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getMerchant_id() {
            return merchant_id == null ? "" : merchant_id;
        }

        public void setMerchant_id(String merchant_id) {
            this.merchant_id = merchant_id;
        }

        public String getStore_id() {
            return store_id == null ? "" : store_id;
        }

        public void setStore_id(String store_id) {
            this.store_id = store_id;
        }

        public String getWarehouse_id() {
            return warehouse_id == null ? "" : warehouse_id;
        }

        public void setWarehouse_id(String warehouse_id) {
            this.warehouse_id = warehouse_id;
        }

        public String getStock_out_id() {
            return stock_out_id == null ? "" : stock_out_id;
        }

        public void setStock_out_id(String stock_out_id) {
            this.stock_out_id = stock_out_id;
        }

        public String getWarehouse_record_id() {
            return warehouse_record_id == null ? "" : warehouse_record_id;
        }

        public void setWarehouse_record_id(String warehouse_record_id) {
            this.warehouse_record_id = warehouse_record_id;
        }

        public String getGoods_class_id() {
            return goods_class_id == null ? "" : goods_class_id;
        }

        public void setGoods_class_id(String goods_class_id) {
            this.goods_class_id = goods_class_id;
        }

        public String getGoods_id() {
            return goods_id == null ? "" : goods_id;
        }

        public void setGoods_id(String goods_id) {
            this.goods_id = goods_id;
        }

        public String getSku_id() {
            return sku_id == null ? "" : sku_id;
        }

        public void setSku_id(String sku_id) {
            this.sku_id = sku_id;
        }

        public String getGoods_name() {
            return goods_name == null ? "" : goods_name;
        }

        public void setGoods_name(String goods_name) {
            this.goods_name = goods_name;
        }

        public String getSku_name() {
            return sku_name == null ? "" : sku_name;
        }

        public void setSku_name(String sku_name) {
            this.sku_name = sku_name;
        }

        public String getSku_id_list() {
            return sku_id_list == null ? "" : sku_id_list;
        }

        public void setSku_id_list(String sku_id_list) {
            this.sku_id_list = sku_id_list;
        }

        public String getGoods_number() {
            return goods_number == null ? "" : goods_number;
        }

        public void setGoods_number(String goods_number) {
            this.goods_number = goods_number;
        }

        public String getSku_goods_number() {
            return sku_goods_number == null ? "" : sku_goods_number;
        }

        public void setSku_goods_number(String sku_goods_number) {
            this.sku_goods_number = sku_goods_number;
        }

        public String getGoods_code() {
            return goods_code == null ? "" : goods_code;
        }

        public void setGoods_code(String goods_code) {
            this.goods_code = goods_code;
        }

        public String getSku_code() {
            return sku_code == null ? "" : sku_code;
        }

        public void setSku_code(String sku_code) {
            this.sku_code = sku_code;
        }

        public String getCompany() {
            return company == null ? "" : company;
        }

        public void setCompany(String company) {
            this.company = company;
        }

        public String getAttribute_state() {
            return attribute_state == null ? "" : attribute_state;
        }

        public void setAttribute_state(String attribute_state) {
            this.attribute_state = attribute_state;
        }

        public String getPricing_method() {
            return pricing_method == null ? "" : pricing_method;
        }

        public void setPricing_method(String pricing_method) {
            this.pricing_method = pricing_method;
        }

        public double getSku_num() {
            return sku_num;
        }

        public void setSku_num(double sku_num) {
            this.sku_num = sku_num;
        }

        public double getStock_price() {
            return stock_price;
        }

        public void setStock_price(double stock_price) {
            this.stock_price = stock_price;
        }

        public String getSale_price() {
            return sale_price == null ? "" : sale_price;
        }

        public void setSale_price(String sale_price) {
            this.sale_price = sale_price;
        }

        public double getStock_num() {
            return stock_num;
        }

        public void setStock_num(double stock_num) {
            this.stock_num = stock_num;
        }

        public double getSubtotal() {
            return subtotal;
        }

        public void setSubtotal(double subtotal) {
            this.subtotal = subtotal;
        }

        public String getRemarks() {
            return remarks == null ? "" : remarks;
        }

        public void setRemarks(String remarks) {
            this.remarks = remarks;
        }

        public String getStock_order_number() {
            return stock_order_number == null ? "" : stock_order_number;
        }

        public void setStock_order_number(String stock_order_number) {
            this.stock_order_number = stock_order_number;
        }

        public String getType() {
            return type == null ? "" : type;
        }

        public void setType(String type) {
            this.type = type;
        }

        public String getAdd_time() {
            return add_time == null ? "" : add_time;
        }

        public void setAdd_time(String add_time) {
            this.add_time = add_time;
        }

        public String getCost_price() {
            return cost_price == null ? "0" : cost_price;
        }

        public void setCost_price(String cost_price) {
            this.cost_price = cost_price;
        }

        public String getExamine_status() {
            return examine_status == null ? "" : examine_status;
        }

        public void setExamine_status(String examine_status) {
            this.examine_status = examine_status;
        }

        public String getSupplier_id() {
            return supplier_id == null ? "" : supplier_id;
        }

        public void setSupplier_id(String supplier_id) {
            this.supplier_id = supplier_id;
        }

        public int getIndex() {
            return index;
        }

        public void setIndex(int index) {
            this.index = index;
        }
    }
}
